<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
	</body>
</html>
<script>
	
	// 将"i love javascript cai guai"的每个单词的第一个字母，变为大写
	// I Love Javascript Cai Guai
	
	// console.log('i love javascript cai guai'.split(' '));
	let arr = 'i love javascript cai guai'.split(' ');
	
	for(let i = 0; i < arr.length; i++){
		arr[i] = arr[i].slice(0,1).toUpperCase().concat(arr[i].slice(1));
	}
	
	console.log(arr.join(' '));
	
</script>